feat(rendition): carry local unit counts through Mistral OCR - #261
Conversation
Exercise the Mistral rendition path with a provider-authenticated local-exact format fixture, including local unit counting, snapshot propagation, and provider unit equality.
roborev: Combined Review (
|
|
looking |
Local-exact responses already undergo count validation in the OCR client. Keep the rendition-level comparison focused on PDFs, which use a different validation method, and share the source count bounds check. Keep the synthetic DOCX test explicit about its temporary authority and verify that a provider count mismatch is rejected. This prepares the rendition path without enabling any new production input formats. Generated with Codex Co-authored-by: Codex <noreply@openai.com>
|
I checked the findings and made the small cleanups. The title now says that this PR carries local unit counts through Mistral OCR. It does not enable any new non-PDF formats. The extra non-PDF mismatch check was redundant: the OCR client rejects that response earlier. I restored the PDF-only check and combined the duplicated source-count validation while preserving the PDF error messages. The DOCX test now builds its ZIP once and checks both a matching response and rejection of three units against a local count of two. I kept the temporary test registration inline and documented that this test must stay sequential. A one-use helper would not enforce that constraint. I also kept the registry test, with a note that it guards future registrations and currently has no registered counters to exercise. Pushed in b8caef1. The full Go suite passed with CGO enabled and disabled; the Mistral race test, lint, and prek checks also passed. |
roborev: Combined Review (
|
The Mistral OCR path accepted output without checking that the provider returned the number of text units the local inspection counted, and the Mistral seam was not ready to claim authority for non-PDF formats. It now carries the verified local unit count through rendition snapshots and compares it with the returned units before output is accepted, leaving the seam ready for non-PDF authority once provider evidence proves the unit semantics.
Unrecognized, malformed, over-limit, and unproved formats continue to fail closed; the existing PDF authority, exact-byte checks, and consent boundary remain unchanged. Callers that need a non-PDF input today must convert it to PDF, while provider evidence is recorded from synthetic inputs or a credentialed probe rather than inferred from hand-written responses.
The change stays inside the Mistral provider adapter and bounded format inspection; other providers, storage, daemon, API, CLI, and UI surfaces remain unchanged.
Refs #175